/**
 * \* Created with IntelliJ IDEA.
 * \* User: Administrator
 * \* Date: 2021/11/3
 * \* Time: 14:45
 * \* To change this template use File | Settings | File Templates.
 * \* Description:
 * \
 */
public class TestDemo {
    //链表
    //val:数据域
    //next:下一个节点的地址
    //head里面存储的就是第一个节点的地址
    //head.next存储的就是下一个节点的地址
    public static void main(String[] args) {
        MyLinkedList myLinkedList=new MyLinkedList();
        // myLinkedList.createList();
        myLinkedList.addFirst(12);
        myLinkedList.addFirst(23);
        myLinkedList.addFirst(34);
        myLinkedList.addFirst(45);
        myLinkedList.addFirst(56);
        myLinkedList.display();
//        myLinkedList.remove(56);
//        myLinkedList.display();
        myLinkedList.clear();
        System.out.println();
    }

    public static void main1(String[] args) {
        MyLinkedList myLinkedList=new MyLinkedList();
       // myLinkedList.createList();
        myLinkedList.addFirst(12);
        myLinkedList.addFirst(23);
        myLinkedList.addFirst(34);
        myLinkedList.addFirst(45);
        myLinkedList.addFirst(56);
        myLinkedList.addIndex(4,99);
        myLinkedList.display();
        boolean flg=myLinkedList.contains(34);

        System.out.println(flg);
        System.out.println(myLinkedList.size());
    }


}
